<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<% String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();%>
<!DOCTYPE html>
<html>

<head>
    <title>国成宝利融资租赁（天津）有限公司-融资租赁管理系统</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet/less" type="text/css" href="<%=basePath%>/resources/common/common.less"/>
    <link rel="stylesheet/less" type="text/css" href="<%=basePath%>/resources/article/write.less"/>
    <link rel="stylesheet" href="<%=basePath%>/resources/plugins/editor/examples/css/style.css"/>
    <link rel="stylesheet" href="<%=basePath%>/resources/plugins/editor/css/editormd.css"/>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/less.js/2.5.3/less.min.js"></script>
</head>
<body>
<div class="body">
    <div class="container">
        <div class="side">
            <a href="<%=basePath%>">
                <button class="btn home">回首页</button>
            </a>
            <span class="add"><i class="fa fa-plus"></i>新建文集</span>
            <div class="create">
                <form action="<%=basePath%>/write/category" method="post" onsubmit="return formValidate()">
                    <input type="text" class="form-control" id="title" name="category" placeholder="请输入文集名"/>
                    <button class="btn btn-add" type="submit">提交</button>
                    <span class="cancel">取消</span>
                </form>
            </div>
            <ul>
                <c:forEach var="item" items="${category}">
                    <a href="<%=basePath%>/write/category/${item.id}">
                        <li data-id="${item.id}"
                            <c:if test="${categoryId==item.id}">class="active" </c:if>
                        >${item.category}</li>
                    </a>
                </c:forEach>
            </ul>
        </div>
        <div class="middle">
            <span class="add" data-category="${categoryId}"><i class="fa fa-plus"></i>新建文章</span>
            <ul class="article">
                <c:forEach items="${article}" var="item">
                    <li data-id="${item.id}">${item.title}</li>
                </c:forEach>
            </ul>
        </div>
        <div class="main">
            <div id="editor">
                <textarea></textarea>
            </div>
        </div>
    </div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="<%=basePath%>/resources/plugins/editor/editormd.min.js"></script>
<script src="<%=basePath%>/resources/article/js/write.js"></script>
</body>
</html>